package org.jsystemtest.tests_proj.analyzer;

import jsystem.framework.analyzer.AnalyzerParameterImpl;

public class NumberCompareAnalyzer extends AnalyzerParameterImpl {

	
	private Integer actual;
	
	private final int expected;
	
	public NumberCompareAnalyzer(int expected) {
		super();
		this.expected = expected;
	}
	

	@Override
	public void analyze() {
		status = false;
		if (actual == null){
			title = "Actual number can't be null";
			return;
		}
		if ((int)actual == expected){
			title = "Actual "+actual +" is equals to "+expected;
			status = true;
		}else {
			title = "Actual "+actual +" is NOT equals to "+expected;
		}
	}
	
	public Class<?> getTestAgainstType() {
		return Integer.class;
	}
	
	public void setTestAgainst(Object o) {
		if (o != null){
			actual = (Integer)o;
		}
	}

}
